package com.vsd.repository;



import java.util.Collection;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;

import com.shopcart.domain.StoreGoods;


@RestResource(exported = false)
public interface StoreGoodsRepository extends CrudRepository<StoreGoods, String> {

	Page<StoreGoods> findByType(Integer type,Pageable p);
	
	Collection<StoreGoods> findByStoreIdAndType(String storeId,Integer type,Sort sort);
	
	Collection<StoreGoods> findByStoreIdAndIsOnlineAndIsDelAndCateCodeAndTypeOrType(String storeId,Integer isOnline,Integer isDel,String cateId,Integer type,Integer type2,Sort sort);
	
	Collection<StoreGoods> findByIdIn(List<String> ids);
	
	Page<StoreGoods> findAll(Pageable p);
	
	Page<StoreGoods> findByNameLike(String name,Pageable p);
}
